<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>
	<script type="text/javascript">
	var obj1={
		name:'jan',
		age:100,
		desc:['son1','son2']
	};
	var obj2={
		name:'jone',
		age:30
	};
	var obj3={
		test1:'test1-value',
		test2:'test2-value',
		items:[{
			key:'key-....'
		},{
			val:'val-....'
		}]
	};
	
	function isEmptyObject(inObj){
		for(var key in inObj){
			return false;
		}
		return true;
	}
	
	/*
	1.foreach obj1;
	
	
	*/
	
	/*
		让目标对象具有源对象上的所有属性
		仅一层复制
	*/
	function extend(inTarget,inSource){
		for (var property in inSource) {
			if(!inSource.hasOwnProperty(property)) continue;
			inTarget[property] = inSource[property];
		}
		return inTarget;
	}
	
	function clone(inObj){
		/*
		var result;
		for(var key in inObj){
			if(!inSource.hasOwnProperty(key)) continue;
			result[key]=inObj[key];
		}
		return result;
		*/
		return extend({},inObj);
	}
	
	
	</script>
</body>
</html>